package com.fernfx.xingtan.common.network;

import java.io.File;
import java.util.Map;

/**
 * 网络请求 接口
 */
public interface ISJJNetworkProxy {

    ISJJNetworkProxy addHeader(String name, String value);
    ISJJNetworkProxy addQueryParam(String name, String value);
    ISJJNetworkProxy setMaxAge(int maxAge);
    ISJJNetworkProxy alreadyEncode(boolean alreadyEncode);


    /**
     * get请求接口
     */
    void get(String url, Map<String, String> headers, IRequestCallback callback);
    void get(String url, Map<String, String> headers, Map<String, String> queries, IRequestCallback callback);

    /**
     * post请求接口 (普通获取数据)
     */
    void post(String url, Map<String, String> headers, String jsonString, IRequestCallback callback);
    void post(String url, Map<String, String> headers, String jsonString, Map<String, String> queries, IRequestCallback callback);

    /**
     * 上传图片接口
     * @param url
     * @param headers
     * @param file
     * @param callback
     */
    void putImage(String url, Map<String, String> headers, File file, IRequestCallback callback);

    /**
     * 撤销请求
     */
    void cancel();
}
